const mongoose = require("mongoose");
mongoose.connect('mongodb://127.0.0.1:27017/test');


function mongooseConnect  (success){
     mongoose.connection.once('open', () => {
         success()
     })

    mongoose.connection.once('error', () => {
        console.log('连接失败');
    })

    mongoose.connection.once('close', () => {
        console.log('连接关闭');
    })
}
module.exports = {
    mongooseConnect
}




